﻿using bpms.Dao;
using bpms.Models;

namespace bpms.Service
{
    /// <summary>
    /// 数据库备份Log业务层
    /// </summary>
    public class BackupDBLogService
    {
        private readonly BackupDBLogDao backupDBLogDao;
        public BackupDBLogService(BackupDBLogDao dao)
        {
            backupDBLogDao = dao;
        }
        public List<BackupDBLog> GetAll(string backupdir)
        {
            return backupDBLogDao.GetAll(backupdir);
        }

        public void BackupMySqlDatabase(string server, string database, string userId,
            string password, string backupFilePath, int type, string mysqldumpPath)
        {
            backupDBLogDao.BackupMySqlDatabase(server, database, userId, password, backupFilePath, type, mysqldumpPath);
        }

        public void RestoreMySqlDatabase(string server, string database, string userId, string password,
            string backupFilePath, string mysqlexePath)
        {
            backupDBLogDao.RestoreMySqlDatabase(server, database, userId, password, backupFilePath, mysqlexePath);
        }
    }
}
